import React from 'react';
import { Image, ImageBackground } from 'react-native';
import { Flex } from 'antd-mobile-rn';
import { createStyles } from '../../../utils/view';
import CText from '../../../components/CText';

const GoodsItem = ({ data }) => (
  <ImageBackground source={require('../../../assets/img/home/item_bg.png')} resizeMode="cover" style={styles.wrapper}>
    <Flex direction="row" justify="between" align="center" >
      <CText>{data.sell_nick_name}</CText>
      <CText size="22">{data.update_time}</CText>
    </Flex>
    <Flex style={styles.row_center} direction="row" justify="between" align="center" >
      <CText color="#C9A43C" size="36">{data.title}</CText>
      <CText color="#980000" size="36">{data.sell_price}元</CText>
    </Flex>
    <Flex direction="row" justify="between" align="center" >
      <Image style={styles.gold} source={require('../../../assets/img/home/gold.png')} />
      <CText size="28" color="#5F4601">微信号: {data.wechat}</CText>
    </Flex>
  </ImageBackground>
);

let styles = {
  wrapper: {
    width: 734,
    height: 246,
    borderRadius: 8,
    paddingTop: 32,
    paddingLeft: 32,
    paddingRight: 32,
    paddingBottom: 36,
    borderColor: '#f5f5f5',
  },
  row_center: {
    marginTop: 29,
    marginBottom: 32,
  },
  gold: {
    width: 80,
    height: 50,
  },
  // btn_buy: {
  //   width: 128,
  //   height: 48,
  //   borderRadius: 24,
  //   justifyContent: 'center',
  //   alignItems: 'center',
  // }
};

styles = createStyles(styles);
export default GoodsItem;